# RPG GAME

import pygame
import sys
import objects
import data
from pygame.locals import*

class Main:
    W = 1000
    H = 900
    bg_rgb = (100,200,200)
    
    def __init__(self):
        pygame.init()
        self.screen = pygame.display.set_mode((self.W,self.H))
        self.player = objects.Player((self.W/2,self.H/2),"tower32x.png")
        self.bg = objects.Player((0,0),"bg.png")
        self.fps = pygame.time.Clock() # creates a clock for limiting FPS
    def gameloop(self):
        while(1):
            self.fps.tick(25)
            mx,my = pygame.mouse.get_pos()
            for event in pygame.event.get(): 
                if event.type == QUIT:
                    sys.exit(0)
                if event.type == KEYDOWN:
                    if event.key == K_a:
                        pass
            self.player.turn(15)
            self.bg.turn(-15)        
                            
            self.player.move() 
            self.bg.move()
#            if data.test_posobject((mx,my),self.player):
#                print 'collidedededede'
            print mx,my
                
            #draw
            self.screen.fill(self.bg_rgb)
            self.screen.blit(self.bg.image,(self.bg.xo,self.bg.yo))
            self.screen.blit(self.player.image,(self.player.xo,self.player.yo))
            pygame.display.flip()
            
if __name__ == '__main__':
    user = Main()
    user.gameloop()